import { type ComputedRef, defineComponent, inject } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>

<%_ if (authenticationTypeOauth2) { _%>
import type LoginService from '@/account/login.service';
<%_ } else { _%>
import { useLoginModal } from '@/account/login-modal';
<%_ } _%>

export default defineComponent({
  setup() {
<%_ if (authenticationTypeOauth2) { _%>
    const { login } = inject<LoginService>('loginService');
<%_ } else { _%>
    const { showLogin } = useLoginModal();
<%_ } _%>
    const authenticated = inject<ComputedRef<boolean>>('authenticated');
    const username = inject<ComputedRef<string>>('currentUsername');

    return {
      authenticated,
      username,
      <% if (authenticationTypeOauth2) { %>login<% } else { %>showLogin<% } %>,
<%_ if (enableTranslation) { _%>
      t$: useI18n().t,
<%_ } _%>
    };
  },
});
